/**
 * 
 */
package fx.parser;

/**
 * @author sajia
 *
 */
public class PhraseExpression extends BooleanExpression {
	private final String phrase;
	
	public PhraseExpression(final String phrase) {
		this.phrase = phrase;
	}
	
	@Override
	protected void matchesWith(final String input, final MatchResult result) {
		boolean matched = input.contains(this.phrase);
		result.setMatched(matched);
		if (matched) {
			result.addMatchedPhrase(this.phrase);
		}
	}
}
